package com.sxt.practiceapplication.view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.ViewPager;

import com.sxt.practiceapplication.utils.LogUtil;

public class InnerViewPager extends ViewPager {

    public InnerViewPager(@NonNull Context context) {
        super(context);
    }

    public InnerViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
//                getParent().requestDisallowInterceptTouchEvent(true);
                LogUtil.d("You down innerViewPager");
                break;
            case MotionEvent.ACTION_UP:
                LogUtil.d("You up innerViewPager");
                break;
            case MotionEvent.ACTION_MOVE:
                LogUtil.d("You move innerViewPager");
        }
        return super.onTouchEvent(event);
    }

}
